#include <stdio.h>

int removeDuplicates(int *nums, int numsSize)
{
    int fast = 1;
    for (int i = 1; i < numsSize; i++)
    {
        if (nums[i] != nums[i - 1])
        {
            nums[fast++] = nums[i];
        }
    }
    return fast;
}

int main()
{
    int nums[] = {0, 0, 1, 1, 1, 2, 2, 3, 3, 4};

    int newSize = removeDuplicates(nums, sizeof(nums) / sizeof(nums[0]));

    for (int i = 0; i < newSize; i++)
    {
        printf("nums[%d] = %d\n",i,nums[i]);
    }
    
    return 0;
}